//
//  rightTagLabel.m
//  GIFShow
//
//  Created by lanou11air029 on 15/4/27.
//  Copyright (c) 2015年 CK. All rights reserved.
//

#import "rightTagLabel.h"

@implementation rightTagLabel
-(instancetype)initWithStyle:(TagLabelStyle)style{
    CGRect screenBounds = [UIScreen mainScreen].bounds;
    CGFloat width = screenBounds.size.width * 0.1;
    CGFloat height = width * 5 / 8;
    
    self = [super initWithFrame:CGRectMake(screenBounds.size.width - width * 1.5, 0, width, height)];
    if (self) {
        self.textAlignment = NSTextAlignmentCenter;
        self.textColor = [UIColor whiteColor];
        self.font = [UIFont systemFontOfSize:13];
        switch (style) {
            case 0:
                self.text = @"原创";
                self.backgroundColor = [UIColor colorWithRed:0.5 green:1 blue:0.5 alpha:1];
                break;
            case 1:
                self.text = @"转载";
                self.backgroundColor =  [UIColor colorWithRed:0.5 green:0.5 blue:1 alpha:1];
                break;
            case 2:
                self.text = @"热门";
                self.backgroundColor =  [UIColor colorWithRed:1 green:0.5 blue:0.5 alpha:1];
                break;
            default:
                break;
        }
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
